package com.kyd.jpa.uid.utils;

import org.springframework.context.ApplicationContextInitializer;
import org.springframework.context.ConfigurableApplicationContext;

/**
 * @author zhuangqi
 * @date 2019-03-26
 */
public class UidInitializer implements ApplicationContextInitializer<ConfigurableApplicationContext> {


    @Override
    public void initialize(ConfigurableApplicationContext applicationContext) {
        applicationContext.getEnvironment().getSystemProperties().put("spring.jpa.properties.hibernate.ejb.identifier_generator_strategy_provider",
                "com.kyd.jpa.uid.utils.GeneratorStrategyProvider");
    }


}
